/** @type {import('webpack').Configuration} */
module.exports = {
  mode: 'none',
  experiments: true,
  externalsType: 'promise',
  externals: {
    // 属性名是我们要排除在打包以外的模块名称  import xxx
    // 属性值是这个模块最终用哪个全局成员替换
    echarts: `null;
    const xhr = new XMLHttpRequest();
    xhr.open('GET', 'https://unpkg.com/echarts@4.8.0/dist/echarts.min.js', false);
    xhr.send();
    eval(xhr.responseText);
    module.exports = echarts;`,
    // echarts: 'echarts', // '(() => { const script = document.createElement("script"); script.src = "" })()',
    jquery: 'jQuery'
  }
}